#include <bits/stdc++.h>
using namespace std;
int n, q, a[300304];
int p[548][19];
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i < 548; ++i) {
    for (register int j = 1, l = 0; l < 19; j <<= 1, l++) {
      register int c = j;
      for (int k = 0; k < 548; ++k) {
        if (c & a[i * 548 + k]) {
          c |= a[i * 548 + k];
        }
      }
      p[i][l] = c;
    }
  }
  int x, y;
  while (q--) {
    cin >> x >> y;
    x--, y--;
    register int c = a[x];
    int xQ = x / 548, yQ = y / 548;
    if (xQ == yQ) {
      for (int i = x + 1; i < y; ++i) {
        if (c & a[i]) {
          c |= a[i];
        }
      }
      if (c & a[y]) {
        cout << "Shi" << endl;
      } else {
        cout << "Fou" << endl;
      }
    } else {
      for (int i = x + 1; i % 548; ++i) {
        if (c & a[i]) {
          c |= a[i];
        }
      }
      while (1) {
        xQ++;
        if (xQ == yQ) {
          for (int i = xQ * 548; i < y; ++i) {
            if (c & a[i]) {
              c |= a[i];
            }
          }
          if (c & a[y]) {
            cout << "Shi" << endl;
          } else {
            cout << "Fou" << endl;
          }
          break;
        } else {
          register int c2 = 0;
          for (int j = 1, l = 0; l < 19; j <<= 1, ++l) {
            if (c & j) {
              c2 |= p[xQ][l];
            }
          }
          c = c2;
        }
      }
    }
  }
}
