#include <bits/stdc++.h>
using namespace std;
int lst[25];
int nxt[7 * 100000 + 5][25];
int a[7 * 100000 + 5];
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < 20; i++) lst[i] = nxt[n + 1][i] = n + 1;
  for (int i = n; i > 0; i--) {
    int x = a[i];
    int tem[25];
    for (int j = 0; j < 25; j++) tem[j] = n + 1;
    for (int j = 0; j < 20; j++) {
      if (x & (1 << j)) {
        tem[j] = i;
        int t = lst[j];
        for (int k = 0; k < 20; k++) {
          tem[k] = min(tem[k], nxt[t][k]);
        }
        lst[j] = i;
      }
    }
    for (int j = 0; j < 20; j++) nxt[i][j] = tem[j];
  }
  for (int i = 1; i <= q; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    int f = 0;
    for (int j = 0; j < 20; j++)
      if (a[y] & (1 << j)) {
        if (nxt[x][j] < y) {
          f = 1;
          break;
        }
      }
    if (f)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
